<template>
  <el-dialog v-model="dialogVisible" width="500" title="禁用一码通" draggable destroy-on-close :close-on-click-modal="false"
    custom-class="login-form-dialog">
    <div class="content">您确认禁用一码通配置吗？</div>
    <div class="tip-box">
      <img src="@/assets/imgs/tip-icon.png" mode="scaleToFill" style="width: 20px;height: 20px;" />
      取消采销一码通配置，将不再自动推送生成运单。
    </div>
    <template #footer>
      <div class="footer">
        <el-button type="primary" @click="submitForm">确认</el-button>
        <el-button @click="dialogVisible=false">取消</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script lang="ts" setup>
  const emit = defineEmits(['success'])
  const dialogVisible = ref(false)
  const rowId = ref()

  const open = async (id) => {
    rowId.value = id
    dialogVisible.value = true
  }

  const submitForm = async () => {
    emit('success', rowId.value)
    dialogVisible.value = false
  }

  defineExpose({ open })
</script>

<style lang="scss" scoped>
  .el-button.code {
    color: #409EFE !important;
  }

  .tip-box {
    display: flex;
    padding: 8px 10px;
    color: #e6a23c;
    border-radius: 4px;
    font-size: 14px;
    background: rgba(230, 162, 60, 0.10);

    img {
      margin-right: 2px;
    }
  }

  .content {
    font-size: 16px;
    margin-bottom: 20px;
  }

  :deep(.el-input--default) {
    height: 40px;
    line-height: 40px;
    font-size: 16px;
  }

  :deep(.el-button--large) {
    font-size: 16px;
  }

  :deep(.el-input__password) {
    font-size: 18px;
  }

  :deep(.el-form-item__label) {
    font-size: 16px;
    color: #909399;
  }

  :deep(.el-form-item__content) {
    font-size: 16px;
    color: #303133;
  }
</style>

<style lang="scss">
  .el-dialog.login-form-dialog {
    box-shadow: 0px 12px 48px 0px rgba(0, 0, 0, 0.03), 0px 9px 28px 0px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08);
  }

  .login-form-dialog .el-dialog__header {
    padding: 30px 40px;
  }

  .login-form-dialog .el-dialog__title {
    font-weight: 500;
    font-size: 28px;
    font-family: PingFang SC, PingFang SC-500;
  }

  .login-form-dialog .el-dialog__body {
    padding: 0px 40px !important;
  }

  .login-form-dialog .el-dialog__footer {
    margin-top: 20px;
    padding: 10px 20px !important;
    border-top: 1px solid #E4E7ED;
  }
</style>